<!DOCTYPE html>
<html lang="en">
    <head>
        {include file="public/header" /}
        <script type="text/javascript">
         app.comment = {
             'id' : {$cat.cat_id}
         }
        </script>
    </head>
    <body>
        {include file="public/nav" /}
        <div class="container">
            <div class="row">

                <div class="col-lg-9">
                    <div id="content" class="main-content">

                        {$cat.cat_content}

                    </div>
                </div>
                
                <div class="col-lg-3">
                    <div class="well">
                        <a href="/index.php/home/article/cat.html?id={$cat.cat_id}"> {$cat.cat_name}</a>
                    </div>
                    <ul id="title" class="list-group">
                        {volist name="docs" id="vo"}
                        <li data-id="{$vo.art_id}" class="list-group-item">
                            {$vo.art_title}
                        </li>
                        {/volist}
                    </ul>                
                </div>
            </div>
        </div>

        
        {include file="public/footer" /}
        {include file="public/js" /}
        <script src="/home/vendor/we/wangEditor.js"></script>
        <script type="text/javascript">
         ;(function(){
             $('#title li').on('click',function(){
                 var url = "post.html";
                 var id = $(this).data('id');
                 var that = $(this);
                 $.ajax({
                     url:url,
                     type : "post",
                     data : {'id':id},
                     dataType: 'html',
                     success : function(data){
                         $('#content').html(data);
                         $('#title li').each(function(){
                             $(this).removeClass('active');
                         });
                         that.addClass('active');
                     },
                     error : function(){
                         $('#content').html("<h3>对不起，没有数据</h3>");
                     }
                 })
             })
         }());
         
        </script>

    </body>
</html>
